package com.xq.jltx.utils;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;

import com.xq.jltx.greendaopro.R;

/**
 * @author jltxseo
 *         Created by junlintianxia on 2016/07/20.
 */
public class FragmentUtils {

    /**
     * TAB方式打开下一个Fragment
     * @param fragmentManager
     * @param fragment
     * @param tag
     */
    public static void openReplaceNextFragment(FragmentManager fragmentManager,Fragment fragment, String tag){
        FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
        fragmentTransaction.replace(R.id.fragment_contain,fragment);
        fragmentTransaction.addToBackStack(tag);
        fragmentTransaction.commit();
    }

}
